CQC Syndication
5. Reports Examples
Example 1 - Retrieve Inspection Report PDF
The GET request below retrieves a single report
Request: https://api.cqc.org.uk/public/v1/reports/f6eb70fb-196f-4b01-948c-1889291a3489
The URL to request other reports is constructed from the API response for an organisation.
For example, the provider response https://api.cqc.org.uk/public/v1/providers/RL4
contains the following in the field reports
which lists published reports:
{
"linkId": "0a387aeb-7194-43fd-9ff3-efbea032770b",
"reportDate": "2018-06-27",
"reportUri": "/reports/0a387aeb-7194-43fd-9ff3-efbea032770b",
"reportType": "Provider"
}
The reportUri
field above should be prefixed with https://api.cqc.org.uk/public/v1
to obtain the download URL for the PDF report.
Example 2 - Retrieve Inspection Report Plain Text
To retrieve only a text extract from the PDF, the URL is unchanged from that for the PDF, but the API client should set the HTTP header Accept: text/plain
. For example, using the command line HTTP client program curl
, the following command will retrieve the text extract for the PDF in Example 1:
curl --header "Accept: text/plain" https://api.cqc.org.uk/public/v1/reports/0a387aeb-7194-43fd-9ff3-efbea032770b
Example 3 - Retrieve Related Reports
Additional document links for a report may be provided in a relatedDocuments
in the provider/location API response. These related documents can be retrieved in the same way as the main report except by constructing the URL from the "documentUri" field instead of the reportUri
field. For example if the reports
field of the organisation response contains the following:
{
"linkId": "f4fdb42e-7d01-44b6-9ad7-da130cf04273",
"reportDate": "2022-01-01",
"firstVisitDate": "2021-11-01",
"reportUri": "/reports/f4fdb42e-7d01-44b6-9ad7-da130cf04273",
"relatedDocuments": [
{
"documentUri": "/reports/f4fdb42e-7d01-44b6-9ad7-da130cf04273/Use%20of%20Resources",
"documentType": "Use of Resources"
}
]
}
then the Use of Resources report PDF can be retrieved using the following GET request:
Request: https://api.cqc.org.uk/public/v1/reports/f4fdb42e-7d01-44b6-9ad7-da130cf04273/Use%20of%20Resources